package indi.zhifa.recipe.bailan.framework.auth.entity.dto.user;
import indi.zhifa.recipe.bailan.framework.auth.entity.dto.user.BaseSignInDto;
import indi.zhifa.recipe.bailan.framework.auth.entity.enums.Gender;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.Pattern;
import java.time.LocalDate;

@Data
public class SignInDto extends BaseSignInDto {

    @Length(min = 2,max = 20,message = "昵称需在2~20个字符内")
    @Schema(title = "昵称")
    private String nickName;

    @Schema(title = "自我描述")
    private String description;

    @Email(message = "邮箱格式不正确")
    @Schema(title = "邮箱地址")
    private String email;

    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message = "手机号不合法")
    @Schema(title = "电话号码")
    private String phone;

    @Schema(title = "性别")
    private Gender gender;

    @Schema(title = "生日")
    private LocalDate birthday;
}
